package com.df.tv.launcher.exception;

import com.df.tv.launcher.LauncherApplication;
import com.df.tv.launcher.R;

/**
 * @author Sky Hong
 * 
 *         ParserDataException
 * 
 */
public class ParseDataException extends TVException {
    private static final long serialVersionUID = 1L;
    /** 解析失败 */
    public static final int PARSE_FAIL = 401;
    /** 无内容解 */
    public static final int PARSE_CONTENT_EMPTY = 402;

    public ParseDataException(int code) {
        super(code);
    }

    public ParseDataException(int code, String msg) {
        super(code, msg);
    }

    @Override
    protected String getMsgByCode(int code) {
        switch (code) {
        case PARSE_FAIL:
            return LauncherApplication.getInstance().getString(R.string.parse_fail);
        case PARSE_CONTENT_EMPTY:
            return LauncherApplication.getInstance().getString(R.string.parse_content_empty);
        }
        return LauncherApplication.getInstance().getString(R.string.unknow_parse_exception);
    }

}
